import { Draw } from "../Draw/Draw";
import { Command } from "../Command/Command";
import { KeyMap } from "../Enumerate/KeyMap";

/** 快捷键 */
export interface IRegisterShortcut {
  key: KeyMap; // 快捷键
  desc: string; // 描述
  ctrl?: boolean;
  meta?: boolean;
  mod?: boolean; // windows:ctrl || mac:command
  shift?: boolean;
  alt?: boolean; // windows:alt || mac:option
  callback?: (command: Command, e?: Event) => void;
  when?: (p: { e: KeyboardEvent; draw: Draw }) => boolean; // 什么时候启用
  preventDefault?: boolean; // 阻止默认事件
  stopPropagation?: boolean; // 阻止冒泡
}
